<!DOCTYPE html>
<html lang="en">
<#include "common/head.html">

<body class="fix-header fix-sidebar">
<!-- Preloader - style you can find in spinners.css -->
<div class="preloader">
    <svg class="circular" viewBox="25 25 50 50">
        <circle class="path" cx="50" cy="50" r="20" fill="none"
                stroke-width="2" stroke-miterlimit="10"/>
    </svg>
</div>
<!-- Main wrapper  -->
<div id="main-wrapper">
    <!-- header header  -->
    <#include "common/header.html">
    <!-- End header header -->
    <!-- Left Sidebar  -->
    <#include "common/nav.html">
    <!-- End Left Sidebar  -->
    <!-- Page wrapper  -->
    <div class="page-wrapper">
        <!-- 锐高软件 -->
        <#include "/common/ruigao.html">

        <!--
                    作者：offline
                    时间：2018-03-26
                    描述：查看信息
                -->
        <div class="container-fluid">
            <!-- Start Page Content -->
            <div class="row justify-content-center">
                <div class="col-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="card-content">
                                <!-- Left sidebar -->
                                <div class="inbox-leftbar">
                                    <a class="btn btn-danger btn-block waves-effect waves-light"
                                       href=""> <font
                                            style="vertical-align: inherit;"> <font
                                            style="vertical-align: inherit;">返回首页</font>
                                    </font>
                                    </a>

                                </div>

                            </div>
                            <!-- End Left sidebar -->

                            <div class="inbox-rightbar show">

                                <div role="toolbar" class="">
                                    <div class="btn-group">
                                        <button class="btn btn-light waves-effect" type="button">
                                            <i class="mdi mdi-archive font-18 vertical-middle"></i>
                                        </button>
                                        <button class="btn btn-light waves-effect" type="button">
                                            <i class="mdi mdi-alert-octagon font-18 vertical-middle"></i>
                                        </button>
                                        <button class="btn btn-light waves-effect" type="button">
                                            <i class="mdi mdi-delete-variant font-18 vertical-middle"></i>
                                        </button>
                                    </div>

                                    <div class="btn-group quanxian">
                                        <button aria-expanded="false" data-toggle="dropdown"
                                                class="btn btn-light dropdown-toggle waves-effect"
                                                type="button">
                                            <font style="vertical-align: inherit;"><font
                                                    style="vertical-align: inherit;">状态查看 </font></font><span
                                                class="caret m-l-5"></span>
                                        </button>

                                        <div class="dropdown-menu">
                                            <a href="applicationpag?status=0" class="dropdown-item">待审</a>
                                            <a href="applicationpag?status=1" class="dropdown-item">未通过</a>
                                            <a href="applicationpag?status=2" class="dropdown-item">已通过</a>
                                        </div>
                                    </div>
                                    <div class="btn-group companyshow">
                                        <button aria-expanded="false" data-toggle="dropdown"
                                                class="btn btn-light dropdown-toggle waves-effect"
                                                type="button">
                                            <font style="vertical-align: inherit;"><font
                                                    style="vertical-align: inherit;">公司</font></font><span
                                                class="caret m-l-5"></span>
                                        </button>

                                        <div class="dropdown-menu">

                                            <a href=""
                                               class="dropdown-item"> </a>
                                        </div>

                                    </div>


                                </div>

                            </div>
                            <div class="">
                                <div class="mt-4">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th><font style="vertical-align: inherit;"> <font
                                                    style="vertical-align: inherit;">任务名</font>
                                            </font></th>
                                            <th><font style="vertical-align: inherit;"> <font
                                                    style="vertical-align: inherit;">详情</font>
                                            </font></th>

                                            <th><font style="vertical-align: inherit;"> <font
                                                    style="vertical-align: inherit;">领取人数</font>
                                            </font></th>

                                            <th><font style="vertical-align: inherit;"> <font
                                                    style="vertical-align: inherit;">奖励</font>
                                            </font></th>
                                            <th><font style="vertical-align: inherit;"> <font
                                                    style="vertical-align: inherit;">操作</font>
                                            </font></th>

                                        </tr>

                                        </thead>
                                        <tbody>
                                        <#list page.pageList as item>
                                        <tr>
                                            <#if (page.pageList)??>
                                            <#if (item.taskTitle)??>
                                            <td name="taskTitle"><font style="vertical-align: inherit;">
                                                <font style="vertical-align: inherit;">${item.taskTitle }</font>
                                            </font></td>
                                        </
                                        #if>
                                        <#if (item.taskInfo)??>
                                        <td name="taskInfo"><font style="vertical-align: inherit;"> <font
                                                style="vertical-align: inherit;">${item.taskInfo }</font>
                                        </font></td>
                                        </
                                        #if>
                                        <#if (item.taskReceivenum)??>
                                        <td name="taskReceivenum"><font style="vertical-align: inherit;"> <font
                                                style="vertical-align: inherit;">${item.taskReceivenum }</font>
                                        </font></td>
                                    </
                                    #if>
                                    <#if (item.taskReward)??>
                                    <td name="taskReward"><font style="vertical-align: inherit;"> <font
                                            style="vertical-align: inherit;">${item.taskReward }</font>
                                    </font></td>
                                </
                                #if>
                                <td class="showmessage">

                                    <button type="button" class="btn btn-success btn-sm btn-rounded m-b-2 m-l-5">
                                        <a href="toupdatetask?taskId=${item.taskId }" style="color: white">修改</a>
                                    </button>
                                    <button type="button" class="btn btn-danger btn-sm btn-rounded m-b-2 m-l-5 del "
                                            name="del">
                                        <a data-delid="${item.taskId}" class='taskdel' style='color: white;'>删除</a>
                                    </button>
                                    <input type="hidden" name="opt" class="opt" value="">
                                </td>
                            </
                            #if>
                            </tr>
                        </
                        #list>
                        </tbody>

                        </table>

                    </div>

                    <div class="table-responsive m-t-40">
                        <div id="example23_wrapper" class="dataTables_wrapper">
                            <div class="dataTables_paginate paging_simple_numbers"
                                 id="example23_paginate">

                                <a href="totasklist?form=1"
                                   class="paginate_button" aria-controls="example23"
                                   data-dt-idx="7" tabindex="0" id="example23"> <font
                                        style="vertical-align: inherit;"> <font
                                        style="vertical-align: inherit;"></font>首页
                                </font>
                                </a>
                                <#if page.getHasPrevPage() == true>
                                <a href="totasklist?form=${page.prevPage}" class="paginate_button previous disabled"
                                   aria-controls="example23" data-dt-idx="0" tabindex="0"
                                   id="example23_previous"><font
                                        style="vertical-align: inherit;"><font
                                        style="vertical-align: inherit;">上一页</font></font></a>
                            </
                            #if>
                            <#if page.getHasNextPage() == true>
                            <a href="totasklist?form=${page.nextPage}"
                               class="paginate_button next" aria-controls="example23"
                               data-dt-idx="7" tabindex="0" id="example23_next"><font
                                    style="vertical-align: inherit;"><font
                                    style="vertical-align: inherit;">下一页</font></font></a>
                        </
                        #if>

                        <a href="totasklist?form=${page.totalPage}"
                           class="paginate_button" aria-controls="example23"
                           data-dt-idx="7" tabindex="0" id="example23"> <font
                                style="vertical-align: inherit;"> <font
                                style="vertical-align: inherit;"></font>末页
                        </font>
                        </a>
                    </div>
                </div>
            </div>


        </div>

    </div>
</div>
</div>
</div>
</div>
</div>
<!-- footer -->
<#include "common/footer.html">
<!-- End footer -->
<#include "common/js.html">
<!--
    作者：offline
    时间：2018-04-09
    描述：点击删除按钮弹窗
-->

<script type="text/javascript">
    $(".taskdel").click(function () {

        var delid = parseInt($(this).data("delid"));
        swal(
            {
                title: "您确定要删除该任务吗？",
                animation: "slide-from-top",
                showCancelButton: true,
                closeOnConfirm: false,
                cancelButtonText: "取消",
                confirmButtonText: "确定"

            },
            function (inputValue) {
                if (inputValue === false)
                    return false;
                $.ajax({
                    url: "dodeltask",
                    type: "GET",
                    data: {
                        "taskId": delid
                    },
                    datatype: "JSON",
                    success: function (
                        data) {
                        if (data) {
                            swal(
                                {
                                    title: "操作成功,<span style='color:red'>已删除</span>任务",
                                    html: true,
                                    type: "success",
                                    showCancelButton: false,
                                    showConfirmButton: true,
                                    confirmButtonText: "确定",
                                },
                                function () {
                                    location.href = "totasklist";
                                });
                        } else {
                            swal({
                                title: '删除失败！',
                                type: 'error',
                                confirmButtonText: '确定',
                                closeOnConfirm: false
                            });
                        }
                    },
                    error: function (
                        data) {
                        swal({
                            title: '操作失败！',
                            type: 'error',
                            confirmButtonText: '确定',
                            closeOnConfirm: false
                        });
                    }

                });
            });

    });

</script>
</body>

</html>